<template>
  <div>
    <span style="letter-spacing:5px; background-image:-webkit-linear-gradient(bottom,#2451d6,#234875,#2ba4ca);
             -webkit-background-clip:text;  -webkit-text-fill-color:transparent; font-size: 20px ;background-color: #e8a400">
            <strong>{{ jgbm }}</strong>

          </span>

      <el-container>
        <el-header style="text-align: center;font-size: 15px;height:16px;margin: 1px">
          <label>检验机构监管{{tableData1.length}}家</label>
        </el-header>
        <el-main >
          <el-table v-loading="loading"height="200" border :data="tableData1"
                    stripe  style="width: 100%">
            <el-table-column fixed :index="indexMethod" type="index" prop="id" label="序号" ></el-table-column>
            <el-table-column prop="jyjg" label="检验机构"></el-table-column>
            <el-table-column prop="hzzh" label="检验机构核准证号" ></el-table-column>
            <el-table-column prop="fw" label="检验范围" ></el-table-column>
            <el-table-column prop="yxq" label="有效期"></el-table-column>
            <el-table-column prop="djl" label="定检率"></el-table-column>

          </el-table>
        </el-main>
      </el-container>



      <el-container>
        <el-header style="text-align: center;font-size: 15px;height:16px;margin: 1px;">
          <label>使用单位监管{{tableData2.length}}家</label>
        </el-header>
        <el-main >
          <el-table v-loading="loading" height="200" border :data="tableData2"
                    stripe style="width: 100%">
            <el-table-column fixed :index="indexMethod" type="index" prop="id" label="序号" ></el-table-column>
            <el-table-column prop="sydw" label="使用单位"></el-table-column>
            <el-table-column prop="sbzl" label="设备总量" ></el-table-column>
            <el-table-column prop="yldj" label="最大压力等级" ></el-table-column>
            <el-table-column prop="tynx" label="投用年限"></el-table-column>
            <el-table-column prop="fxdj" label="风险等级"></el-table-column>
          </el-table>
        </el-main>
      </el-container>

      <el-container>
        <el-header style="text-align: center;font-size: 15px;height:16px;margin: 1px;">
          <label>锅炉设备监管{{tableData3.length}}台</label>
        </el-header>
        <el-main >
          <el-table v-loading="loading" height="200"border :data="tableData3"
                    stripe style="width: 100%">
            <el-table-column fixed :index="indexMethod" type="index" prop="id" label="序号" ></el-table-column>

            <el-table-column prop="sbdm" label="设备代码" ></el-table-column>
            <el-table-column prop="tyrq" label="投用日期"></el-table-column>
            <el-table-column prop="sydw" label="使用单位"></el-table-column>
            <el-table-column prop="fxdj" label="风险等级"></el-table-column>
            <el-table-column prop="zyys" label="主要风险因素"></el-table-column>
          </el-table>
        </el-main>
      </el-container>

  </div>
</template>

<script>
    import Breadcrumb from "../../BreadCrumb/BreadCrumb";
    //import guoluData from '../../../../../assets/guoluData.json'
    import Jgbmtable1 from '../../../../../assets/Jgbmtable1.json'
    import Jgbmtable2 from '../../../../../assets/Jgbmtable2.json'
    import Jgbmtable3 from '../../../../../assets/Jgbmtable3.json'
    import * as echarts from "echarts";

    export default {
      name: "detail",
      props: {
        jgbm: {
          type: String,
          default: ""
        }

      },
      data() {
        return {
          naviBasicItems: [{ text: '电站锅炉' }, { text: '监管部门', to: '/guolu/dataCloudService/jgbm' }],
          naviItems: [],
          total: 1000,
          pagesize: 1000,
          currentPage: 1,
          loading: false,
          tableData: [],
          tableData1: [],
          tableData2: [],
          tableData3: [],
        }
      },
      created() {
        (this.naviItems = [...this.naviBasicItems]);
        this.getTableData1();
        this.getTableData2();
        this.getTableData3();
      },
      components: {
        Breadcrumb,
      },
      methods: {
        indexMethod(index) {
          return (this.currentPage - 1) * this.pagesize + index + 1
        },
        getTableData1() {

          switch (this.jgbm) {

            case "国家市场监督管理总局":
              this.tableData1 = [
                {"jyjg":"铜陵市特种设备监督检验中心","hzzh":"TS7110411-2024","dz":"安徽省铜陵市开发区翠湖五路1991号","fw":"GD3、GD4","yxq":"2024/10/8","djl":"100%"},
                {"jyjg":"山东省特种设备检验研究院","hzzh":"TS7110350-2024","dz":"山东省济南市高新区天辰路939号","fw":"GD1、GD2、GD3、GD4","yxq":"2024/11/30","djl":"100%"},
                {"jyjg":"中国特种设备检测研究院","hzzh":"TS7110001-2022","dz":"北京市朝阳区和平街西苑2号","fw":"GD1、GD2、GD3、GD4","yxq":"2022/12/5","djl":"100%"}
              ];
              break;
            case "山东省市场监督管理局":
            case "济宁市市场监督管理局":
            case "青岛市市场监督管理局":
              this.tableData1.push(Jgbmtable1[1]);
              break;
            //this.tableData1.push(Jgbmtable1[2]);break;
            case "浙江省市场监督管理局":
            case "金华市市场监督管理局":
            case "温州市市场监督管理局":
            case "舟山市市场监督管理局":
            case "江苏省市场监督管理局":
            case "无锡市市场监督管理局":
            case "河北省市场监督管理局":
            case "邢台市市场监督管理局":
            case "河南省市场监督管理局":
            case "三门峡市市场监督管理局":
            case "山西省市场监督管理局":
            case "忻州市市场监督管理局":
            case "吉林省市场监督管理厅":
            case "长春市市场监督管理局":
            case "甘肃省市场监督管理局":
            case "安徽省市场监督管理局":
            case "铜陵市市场监督管理局":
              this.tableData1.push(Jgbmtable1[3]);
              break;
            default:
              //this.tableData1.push(Jgbmtable1[3]);
              break;
          }

        },
        getTableData2() {
          switch (this.jgbm) {

            case "国家市场监督管理总局":
              //this.tableData2=[];
              this.tableData2 = Jgbmtable2;
              break;
            case "安徽省市场监督管理局":
            case "铜陵市市场监督管理局":

              //this.tableData2=[];
              for(let i=0;i<135;i++){
                this.tableData2.push(Jgbmtable2[i]);
              }
              break;

            case "山东省市场监督管理局":
            case "济宁市市场监督管理局":
            case "青岛市市场监督管理局":
              //this.tableData2 = [];
              for (let i = 135; i < 165; i++) {
                this.tableData2.push(Jgbmtable2[i]);
              }
              break;

            case "浙江省市场监督管理局":
            case "金华市市场监督管理局":
            case "温州市市场监督管理局":
            case "舟山市市场监督管理局":
            case "江苏省市场监督管理局":
            case "无锡市市场监督管理局":
            case "河北省市场监督管理局":
            case "邢台市市场监督管理局":
            case "河南省市场监督管理局":
            case "三门峡市市场监督管理局":
            case "山西省市场监督管理局":
            case "忻州市市场监督管理局":
            case "吉林省市场监督管理厅":
            case "长春市市场监督管理局":
            case "甘肃省市场监督管理局":
            case "安徽省市场监督管理局":
            case "铜陵市市场监督管理局":
              //this.tableData2=[];
              for(let i=165;i<174;i++){
                this.tableData2.push(Jgbmtable2[i]);
              }
              break;
            default:
              break;
          }
        },
        getTableData3() {
          switch (this.jgbm) {

            case "国家市场监督管理总局":
              //this.tableData2=[];
              this.tableData3 = Jgbmtable3;
              break;
            case "安徽省市场监督管理局":
            case "铜陵市市场监督管理局":

              //this.tableData2=[];
              for(let i=0;i<236;i++){
                this.tableData3.push(Jgbmtable3[i]);
              }
              break;

            case "山东省市场监督管理局":
            case "济宁市市场监督管理局":
            case "青岛市市场监督管理局":
              //this.tableData2 = [];
              for (let i = 236; i < 286; i++) {
                this.tableData3.push(Jgbmtable3[i]);
              }
              break;

            case "浙江省市场监督管理局":
            case "金华市市场监督管理局":
            case "温州市市场监督管理局":
            case "舟山市市场监督管理局":
            case "江苏省市场监督管理局":
            case "无锡市市场监督管理局":
            case "河北省市场监督管理局":
            case "邢台市市场监督管理局":
            case "河南省市场监督管理局":
            case "三门峡市市场监督管理局":
            case "山西省市场监督管理局":
            case "忻州市市场监督管理局":
            case "吉林省市场监督管理厅":
            case "长春市市场监督管理局":
            case "甘肃省市场监督管理局":
            case "安徽省市场监督管理局":
            case "铜陵市市场监督管理局":
              //this.tableData2=[];
              for(let i=286;i<301;i++){
                this.tableData3.push(Jgbmtable3[i]);
              }
              break;
            default:
              break;
          }
        },

      },
    }


</script>

<style scoped>

</style>
